package com.ssy.lingxi.logistics.model.enums;

import com.ssy.lingxi.common.language.LanguageHolder;
import com.ssy.lingxi.logistics.api.validate.IntArrayValuable;

import java.util.Arrays;

/**
 * 收货地址创建方式枚举
 * @author yzc
 * @version 2.0.0
 * @date 2020/7/14
 */
public enum ReceiverAddressCreateTypeEnum implements IntArrayValuable {

    /**
     * 正常创建 - 1
     */
    LOGISTICS(1, "正常创建"),

    /**
     * 转单新增 - 2
     */
    TRANSFER_ORDER(2, "转单新增"),

    /**
     * 门店新增 - 3
     */
    STORE_CREATE(3, "门店新增");


    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(ReceiverAddressCreateTypeEnum::getCode).toArray();

    private Integer code;

    @Override
    public int[] array() {
        return ARRAYS;
    }

    ReceiverAddressCreateTypeEnum(Integer code, String message) {
        this.code = code;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return LanguageHolder.getName(this.getClass(),this.code);
    }

}
